export function get_ele_left(ele: HTMLElement) {
  let value = ele.offsetLeft;
  let parent: HTMLElement | null = ele.offsetParent as HTMLElement;
  while (parent !== null) {
    value += parent.offsetLeft;
    parent = parent.offsetParent as HTMLElement;
  }
  if (document.compatMode == "BackCompat")
    return value - document.body.scrollLeft;
  return value - document.documentElement.scrollLeft;
}
